package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import java.util.List;

import retrofit2.Call;

/**
 * 类说明：
 * 作者：huangqiuxin on 2016/5/14 14:42
 * 邮箱：648859026@qq.com
 */
public class GuideAddInteractionAction extends AHttpService<PbBean.PbResGuideAddInteraction>{
    /**
     * 搭配指导添加互动
     * @param context
     * @param guideId 指导ID
     * @param content 内容
     * @param imageTokenList 图片列表
     * @return
     */
    public static GuideAddInteractionAction newInstance(Context context, int guideId, String content, List<String> imageTokenList){
        return new GuideAddInteractionAction(context, guideId, content,imageTokenList);
    }
    private int guideId;
    private String content;
    private List<String> imageTokenList;
    private GuideAddInteractionAction(Context context, int guideId, String content, List<String> imageTokenList) {
        super(context);
        this.guideId =guideId;
        this.content = content;
        this.imageTokenList = imageTokenList;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqGuideAddInteraction.Builder builder = PbBean.PbReqGuideAddInteraction.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setGuideId(guideId);
        builder.setContent(content);
        if(imageTokenList != null){
            builder.addAllImageTokenList(imageTokenList);
        }

        return apiService.guideAddInteraction(builder.build());
    }
}
